class Ualia < ActiveRecord::Base
belongs_to :user
has_many :photos

  validates_presence_of     :email_addr, :name
  validates_uniqueness_of     :email_addr, :name  
  
  validates_format_of     :email_addr,:with=> /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,:message    => 'email must be valid'   
def before_create
  self.user_id = current_user.id

end
end
